<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	   xmlns:mvc="http://www.springframework.org/schema/mvc"
	   xmlns:context="http://www.springframework.org/schema/context"
	   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	   xsi:schemaLocation="
        http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/mvc
        http://www.springframework.org/schema/mvc/spring-mvc.xsd
        http://www.springframework.org/schema/context
        http://www.springframework.org/schema/context/spring-context.xsd">
	
	<context:component-scan base-package="org.geoserver.wps.gs.download.rest"/>

	<!--
    ====================================================================
-->
	<!-- Property config files -->
	<!-- Any customization should go in the property file -->
	<!--
		====================================================================
		
	-->
	<bean id="downloadServiceConfigurationWatcher" 
		class="org.geoserver.wps.gs.download.DownloadServiceConfigurationWatcher" destroy-method="stop"/>
 
	<bean id="downloadEstimatorProcess" class="org.geoserver.wps.gs.download.DownloadEstimatorProcess">
		<constructor-arg index="0" ref="downloadServiceConfigurationWatcher" />
		<constructor-arg index="1" ref="geoServer"/>
	</bean>
	   
	<bean id="downloadProcess" class="org.geoserver.wps.gs.download.DownloadProcess">
		<constructor-arg index="0" ref="geoServer"/>
		<constructor-arg index="1" ref="downloadEstimatorProcess"/>
		<constructor-arg index="2" ref="wpsResourceManager"/>
	</bean>
	
	<bean id="downloadMapProcess" class="org.geoserver.wps.gs.download.DownloadMapProcess">
		<constructor-arg index="0" ref="geoServer"/>
		<constructor-arg index="1" ref="httpWarningAppender"/>
	</bean>

	<bean id="downloadAnimationProcess" class="org.geoserver.wps.gs.download.DownloadAnimationProcess">
		<constructor-arg index="0" ref="downloadMapProcess"/>
		<constructor-arg index="1" ref="wpsResourceManager"/>
		<constructor-arg index="2" ref="downloadServiceConfigurationWatcher" />
		<constructor-arg index="3" ref="httpWarningAppender"/>
		<constructor-arg index="4" ref="rasterCleaner" />
	</bean>
	
	<bean id="animationMetadataPPIO" class="org.geoserver.wps.gs.download.AnimationMetadataPPIO"/>
	<bean id="downloadMetadataPPIO" class="org.geoserver.wps.gs.download.DownloadMetadataPPIO"/>

	<!-- The PPIO that need to be registered into SPI because of their dependencies -->
	<bean id="archiveZipPPIO" class="org.geoserver.wps.ppio.ZipArchivePPIO">
	  <constructor-arg index="0" value="4"/>
	</bean>

	<bean id="downloadLayerPPIO" class="org.geoserver.wps.gs.download.JaxbPPIO">
		<constructor-arg index="0" value="org.geoserver.wps.gs.download.Layer"/>
		<constructor-arg index="1" ref="entityResolverProvider"/>
	</bean>

	<bean id="downloadParametersPPIO" class="org.geoserver.wps.gs.download.JaxbPPIO">
		<constructor-arg index="0" value="org.geoserver.wps.gs.download.Parameters"/>
		<constructor-arg index="1" ref="entityResolverProvider"/>
	</bean>

	<bean id="downloadFormatPPIO" class="org.geoserver.wps.gs.download.JaxbPPIO">
		<constructor-arg index="0" value="org.geoserver.wps.gs.download.Format"/>
		<constructor-arg index="1" ref="entityResolverProvider"/>
	</bean>
	
	<bean id="geopkgVectorPPIO" class="org.geoserver.wps.gs.download.GeopkgVectorPPIO"/>
	<bean id="geopkgRasterPPIO" class="org.geoserver.wps.gs.download.GeopkgRasterPPIO"/>

	<bean id="verticalCrsConfigPanel"
		  class="org.geoserver.web.data.resource.ResourceConfigurationPanelInfo">
		<property name="id" value="coverage" />
		<property name="titleKey" value="data.resource.config.coverage" />
		<property name="componentClass"
				  value="org.geoserver.web.wps.VerticalCRSConfigurationPanel" />
		<property name="supportedTypes">
			<list>
				<value>org.geoserver.catalog.CoverageInfo</value>
			</list>
		</property>
	</bean>

	<bean id="wpsDownloadAdminPanel" class="org.geoserver.web.services.AdminPagePanelInfo">
		<property name="id" value="wpsDownloadAdminPanel"/>
		<property name="titleKey" value="wpsDownload"/>
		<property name="componentClass" value="org.geoserver.web.wps.DownloadLimitsPanel"/>
		<property name="serviceClass" value="org.geoserver.wps.WPSInfo"/>
	</bean>
	
    
</beans>